package com.raysun.androidbase.service.extension

import android.app.Service
import android.content.Intent
import android.os.Binder
import android.os.IBinder

class BinderService : Service() {

    private val binder = LocalBinder()

    var connectedTimes: Int = 1

    override fun onBind(intent: Intent?): IBinder {
        connectedTimes--
        return binder
    }

    inner class LocalBinder : Binder() {
        fun getService(): BinderService = this@BinderService
    }
}